package com.osfw.dbadminer.entity.config;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.osfw.framework.core.entity.BaseEntity;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 数据库操作审批流程配置
 */
@Data
@Accessors(chain = true)
public class DbaConfigProcess extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /* 操作流程配置ID */
    @TableId(value = "process_id_", type = IdType.ASSIGN_ID)
    private Long processId;

    /* 数据库连接ID */
    @TableField(value = "connect_id_")
    private Long connectId;

    /* 数据库连接ID */
    @TableField(exist = false)
    private String connectName;

    /* 数据库名称 */
    @TableField(value = "database_name_")
    private String databaseName;

    /* 数据表名称 */
    @TableField(value = "datatable_name_")
    private String datatableName;

    /* 操作类型（insert-插入数据，update-修改数据，delete-删除数据，query-查询数据，other-其他操作） */
    @TableField(value = "oper_type_")
    private String operType;

    /* 审批流程KEY */
    @TableField(value = "proc_key_")
    private String procKey;

    /* 删除标志（0-代表存在，2-代表删除） */
    @TableField(value = "del_flag_")
    private String delFlag;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("processId", getProcessId())
                .append("connectId", getConnectId())
                .append("databaseName", getDatabaseName())
                .append("datatableName", getDatatableName())
                .append("operType", getOperType())
                .append("procKey", getProcKey())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createByName", getCreateByName())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateByName", getUpdateByName())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }

}
